package com.ycz.pattern.behaviour.interpreterpattern;

/**
 * @Description
 * @ClassName TerminalExpression
 * @Author yanchengzhi
 * @date 2023.12.04 00:39
 */
public class TerminalExpression implements Expression {

    private String data;

    public TerminalExpression(String data) {
        this.data = data;
    }

    @Override
    public boolean interpret(String context) {
        if (context.contains(data)) return true;
        return false;
    }
}
